import request from '@/utils/request'

//查询分类
export function getdic(dicname,currentPage,pagesizes) {
  return request({
    url: '/dic/list',
    method: 'get',
    params: { dicname ,currentPage,pagesizes }
  })
}

//查询总数
export function getTotal() {
  return request({
    url: '/dic/total',
    method: 'get',

  })
}

//分类删除
export function deletedic(dcId) {
  return request({
    url: `/dic/${dcId}`,
    method: 'delete',
  })
}
//根据dc_type查所有
export function gettypedic(type) {
  return request({
    url: `/dic/get/${type}`,
    method: 'get',
  })
}

//根据id查询
export function getByIddic(dcId) {
  return request({
    url: `/dic/${dcId}`,
    method: 'get',
  })
}

//更新
export  function Updatedic(commonDic){
  return request({
    url: `/dic/update`,
    method: 'put',
    data:commonDic
  })
}

//新增
export function addDic(data) {
  return request({
    url: '/dic/insert',
    method: 'post',
    data,
  })

}
